#include <stdio.h>
#include <windows.h>

#include "config.h"
#include "event.h"
#include "util.h"

int
main(int argc, char **argv)
{
	FILE *fp;
	char *in_file;
	int r;
	struct config config;

	if (argc != 2) {
		fprintf(stderr, "usage: %s config_file\n", argv[0]);
		exit(1);
	}

	in_file = argv[1];

	fp = fopen(in_file, "rb");
	if (fp == NULL) {
		fprintf(stderr, "error: could not open %s\n", in_file);
		exit(1);
	}

	r = fread(&config, 1, sizeof(config), fp);

	if (!valid_config(&config)) {
		fprintf(stderr, "error: invalid config read.\n");
		exit(1);
	}

	dump_config(&config);

	fclose(fp);

	return 0;
}
